// input focus end
export function inputEnd(inputValue, inputRef) {
  const length = inputValue.length;
  inputRef?.setSelectionRange(length, length);
}

export function unionById(arr1, arr2) {
  const lookup = {};
  arr1.forEach((item) => {
    lookup[item.id] = item;
  });

  arr2.forEach((item) => {
    lookup[item.id] = item;
  });

  return Object.values(lookup);
}
